﻿//数据库驱动

unit QFDBDriver;

interface

uses
  SysUtils, SynOleDB, SynDB, SynCommons
  ;

type
  TMSSql = class
  private
    fMSSql: TOleDBMSSQLConnectionProperties;
    FdatabaseIP, FdatabaseName, Fuser, Fpassword: RawUTF8;
  public
    constructor Create(const databaseIP, databaseName, User, password: RawUTF8);
    destructor Destroy; override;
    property MSSQL: TOleDBMSSQLConnectionProperties read fMSSql;
  end;
implementation

{ TMsSql }
constructor TMSSql.Create(const databaseIP, databaseName, User,
  password: RawUTF8);
begin
  FdatabaseIP := databaseIP;
  FdatabaseName := databaseName;
  Fuser := User;
  Fpassword := password;
  fMSSql := TOleDBMSSQLConnectionProperties.Create(FdatabaseIP, FdatabaseName,
    Fuser, Fpassword);
end;

destructor TMSSql.Destroy;
begin
  if fMSSql <> nil then
  begin
    fMSSql.ClearConnectionPool;
    fMSSql.Free;
    fMSSql := nil;
  end;

  inherited;
end;

end.
